/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.camachosanchez.bean;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author ZULLY
 */
@Entity
@Table(name = "configuracion_baja_neumatico")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ConfiguracionBajaNeumatico.findAll", query = "SELECT c FROM ConfiguracionBajaNeumatico c"),
    @NamedQuery(name = "ConfiguracionBajaNeumatico.findById", query = "SELECT c FROM ConfiguracionBajaNeumatico c WHERE c.id = :id"),
    @NamedQuery(name = "ConfiguracionBajaNeumatico.findByDescripcion", query = "SELECT c FROM ConfiguracionBajaNeumatico c WHERE c.descripcion = :descripcion"),
    @NamedQuery(name = "ConfiguracionBajaNeumatico.findByColor", query = "SELECT c FROM ConfiguracionBajaNeumatico c WHERE c.color = :color"),
    @NamedQuery(name = "ConfiguracionBajaNeumatico.findByValorInicial", query = "SELECT c FROM ConfiguracionBajaNeumatico c WHERE c.valorInicial = :valorInicial"),
    @NamedQuery(name = "ConfiguracionBajaNeumatico.findByValorFinal", query = "SELECT c FROM ConfiguracionBajaNeumatico c WHERE c.valorFinal = :valorFinal"),
    @NamedQuery(name = "ConfiguracionBajaNeumatico.findByEstado", query = "SELECT c FROM ConfiguracionBajaNeumatico c WHERE c.estado = :estado ORDER BY c.valorInicial, c.valorFinal")})
public class ConfiguracionBajaNeumatico implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "descripcion")
    private String descripcion;
    @Basic(optional = false)
    @Column(name = "color")
    private int color;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @Column(name = "valor_inicial")
    private BigDecimal valorInicial;
    @Basic(optional = false)
    @Column(name = "valor_final")
    private BigDecimal valorFinal;
    @Basic(optional = false)
    @Column(name = "estado")
    private boolean estado;
    @Column(name = "nro_reencauches")
    private Short nroReencauches;
    @JoinColumn(name = "id_estado_medicion", referencedColumnName = "id")
    @ManyToOne(fetch = FetchType.LAZY)
    private EstadosMedicion idEstadoMedicion;
    
    public ConfiguracionBajaNeumatico() {
    }

    public ConfiguracionBajaNeumatico(Integer id) {
        this.id = id;
    }

    public ConfiguracionBajaNeumatico(Integer id, String descripcion, int color, BigDecimal valorInicial, BigDecimal valorFinal, boolean estado) {
        this.id = id;
        this.descripcion = descripcion;
        this.color = color;
        this.valorInicial = valorInicial;
        this.valorFinal = valorFinal;
        this.estado = estado;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public int getColor() {
        return color;
    }

    public void setColor(int color) {
        this.color = color;
    }

    public BigDecimal getValorInicial() {
        return valorInicial;
    }

    public void setValorInicial(BigDecimal valorInicial) {
        this.valorInicial = valorInicial;
    }

    public BigDecimal getValorFinal() {
        return valorFinal;
    }

    public void setValorFinal(BigDecimal valorFinal) {
        this.valorFinal = valorFinal;
    }

    public boolean getEstado() {
        return estado;
    }

    public void setEstado(boolean estado) {
        this.estado = estado;
    }

    public Short getNroReencauches() {
        return nroReencauches;
    }

    public void setNroReencauches(Short nroReencauches) {
        this.nroReencauches = nroReencauches;
    }
    
    public EstadosMedicion getIdEstadoMedicion() {
        return idEstadoMedicion;
    }

    public void setIdEstadoMedicion(EstadosMedicion idEstadoMedicion) {
        this.idEstadoMedicion = idEstadoMedicion;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ConfiguracionBajaNeumatico)) {
            return false;
        }
        ConfiguracionBajaNeumatico other = (ConfiguracionBajaNeumatico) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return descripcion;
    }

}
